# -*- coding: utf8 -*-
"""In this demo /admin is not very useful.
Left only for convenience to have a link to localhost datastore.
(For localhost this separation may be not necessary.)
"""

__author__ = 'Artem Dudarev'
__licence__ = 'Apache 2.0'
__date__ = 'Fri 19 Mar 2010 01:31:50 PM EET'

from django.utils import simplejson as json
import logging

from google.appengine.ext import webapp
from google.appengine.ext import db
from google.appengine.api import memcache
from google.appengine.ext.webapp.util import run_wsgi_app

from geotree.geotree import GeoTree


class AdminHandler(webapp.RequestHandler):

    def get(self,action=None):
        self.response.out.write('Admin page<br/><br/>')
        self.response.out.write('<a href="/">Home</a><br/>')
        self.response.out.write('<a href="/_ah/admin">App Engine localhost admin</a><br/>')
    
logging.getLogger().setLevel(logging.DEBUG)
application = webapp.WSGIApplication([
                                    ('/admin', AdminHandler),
                                    ('/admin/(.*)', AdminHandler),
                                    ],
                                   debug=True)

def main():
    run_wsgi_app(application)

if __name__ == '__main__':
    main()
